<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">BOM详情</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">BOM编号</th>
                        <td>{$row.bom_no}</td>
                    </tr>
                    <tr>
                        <th>产品名称</th>
                        <td>{$row.productModel.product.name}</td>
                    </tr>
                    <tr>
                        <th>产品型号</th>
                        <td>{$row.productModel.name}</td>
                    </tr>
                    <tr>
                        <th>物料数量</th>
                        <td>{$row.material_count}</td>
                    </tr>
                    <tr>
                        <th>总用量</th>
                        <td>{$row.total_quantity}</td>
                    </tr>
                </table>
            </div>
            <div class="col-md-6">
                <table class="table table-bordered">
                    <tr>
                        <th width="120">状态</th>
                        <td>
                            {if $row.status == 1}
                                <span class="label label-success">启用</span>
                            {else}
                                <span class="label label-danger">停用</span>
                            {/if}
                        </td>
                    </tr>
                    <tr>
                        <th>创建时间</th>
                        <td>{$row.createtime|datetime}</td>
                    </tr>
                    <tr>
                        <th>更新时间</th>
                        <td>{$row.updatetime|datetime}</td>
                    </tr>
                </table>
            </div>
        </div>
        
        {if $row.remark}
        <div class="row">
            <div class="col-md-12">
                <h4>备注</h4>
                <p>{$row.remark}</p>
            </div>
        </div>
        {/if}
        
        <!-- BOM明细 -->
        <div class="row">
            <div class="col-md-12">
                <h4>BOM明细</h4>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>物料编码</th>
                            <th>物料名称</th>
                            <th>物料分类</th>
                            <th>规格型号</th>
                            <th>单位</th>
                            <th>用量</th>
                            <th>位置</th>
                            <th>备注</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach $bomDetails as $index => $detail}
                        <tr>
                            <td>{$index + 1}</td>
                            <td>{$detail.material.material_code}</td>
                            <td>{$detail.material.material_name}</td>
                            <td>{$detail.material.category.name}</td>
                            <td>{$detail.material.specification}</td>
                            <td>{$detail.material.unit}</td>
                            <td>{$detail.quantity}</td>
                            <td>{$detail.position}</td>
                            <td>{$detail.remark}</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
